package com.lwl.blue.commont.utils;

import java.util.UUID;

/**
 * <p>
 *
 * </p>
 *
 * @version V0.0.1
 * @date 2020/3/18
 */

public class NumberUtils {

    private volatile static NumberUtils numberUtils = null;

    public static NumberUtils getInstance() {
        if (numberUtils == null) {
            synchronized (NumberUtils.class) {
                if (numberUtils == null) {
                    synchronized (NumberUtils.class) {
                        numberUtils = new NumberUtils();
                    }

                }
            }
        }
        return numberUtils;
    }

    private NumberUtils() {
    }

    public static String createNum(String type, Integer size) {
        String uuid = UUID.randomUUID().toString().replace("-", "");
        String string = uuid.substring(uuid.length() - size);
        return type + string;
    }

    public static String createMd5(Integer size) {
        String uuid = UUID.randomUUID().toString().replace("-", "");
        return uuid.substring(uuid.length() - size);
    }

}
